<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<c:set var="grant_code">
	<x:out select="$xmlData/data/proposal/grant_code" />
</c:set>
<c:set var="sub_grant_code">
	<x:out select="$xmlData/data/proposal/sub_grant_code" />
</c:set>

<div class="t_bar">
	<span class="color_red">*</span>申请资助资金及使用计划（资金使用计划应列明具体的改造项目、平台建设、公益性活动等及完成时间、相应的资金支出安排。）
</div>
<div class="t_bar">
	申请资助资金总额：<input
		type="text" name="budgets/total_funds1" id="total_funds1" class="gray" 
		disabled label="申请资助资金总额" style="text-align: left; width: 260px;background-color:#e6e6e6;"
		value="<x:out select="$xmlData/data/budgets/total_funds1" />" />
		
		<input type="hidden" name="budgets/total_funds" id="total_funds" class="gray"
		disabled label="申请资助资金总额" style="text-align: right; width: 100px;"
		value="<x:out select="$xmlData/data/budgets/total_funds" />" >
</div>

<table id="tblBudgets" cellpadding="0" class="table01" width="100%"
	border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
	<thead>
		<tr style="border: 1px solid #B7D1E6">
			<th class="TblHead" align="center" width="30px">选择</th>
			<th class="TblHead" align="center" width="30px">序号</th>
			<th class="TblHead" align="center" width="300px">内容</th>
			<th class="TblHead" align="center" width="125px">完成时间</th>
			<th class="TblHead" align="center" width="125px">总投入金额(万元)</th>
			<th class="TblHead" align="center" width="125px">申请资助额(万元)</th>
		</tr>
	</thead>
	<tbody id="tab">
		<tr style="display: none">
			<td align="center"><input type="radio" class="radiobutton" name="selBudgets">
			</td>
			<td align="center"><span name="budgets|budget[0]@seq_no">[index]</span></td>
			
			<td align="center"><input name="budgets|budget[0]|context"
				class="input_text required" maxlength=200 style="width: 250px"
				label="内容" value="">
			</td>
			<td align="center"><input name="budgets|budget[0]|date"
				id="budget_date_[0]" label="完成时间" value=""
				class=" required input_text date " style="width: 70px" />
			</td>
			<td align="center"><input name="budgets|budget[0]|budget_total" id="budget_total_[0]"
				class="input_text required valueGreatEqual:budget_total_[0]:budget_fund_[0]" maxlength=50
				onfocus="InitInput.setNumber(this,8,4,2)"
				style="text-align: right; width: 100px" label="总投入金额" value="">
			</td>
			<td align="center"><input name="budgets|budget[0]|budget_fund" id="budget_fund_[0]"
				class="input_text required" maxlength=50
				onfocus="InitInput.setNumber(this,8,4,2)"
				onchange="countTable('tblBudgets','total_funds',5);lw('total_funds1','total_funds');"
				style="text-align: right; width: 100px" label="申请资助额" value="">
			</td>



			<c:set value="0" var="index" scope="page" />
			<x:forEach select="$xmlData/data/budgets/budget" var="budget">

				<c:choose>
					<c:when test="${index<10}">
						<c:set value="0" var="flag" scope="page" />
					</c:when>
					<c:otherwise>
						<c:set value="" var="flag" scope="page" />
					</c:otherwise>
				</c:choose>
				<tr>
					<td align="center"><input type="radio" class="radiobutton" name="selBudgets"></td>
					<td align="center"><span
						name="budgets/budget[${flag}${index}]@seq_no"><x:out
								select="$budget/@seq_no" /></span>
					</td>
					<td align="center"><input
						name="budgets/budget[${flag}${index}]/context"
						class="input_text required" maxlength=200 style="width: 250px"
						label="内容" value="<x:out select="$budget/context"/>" />
					</td>
					<td align="center"><c:set var="date" scope="page">
							<x:out select="$budget/date" />
						</c:set><input value="${date}" label="完成时间"
						id="budget_date_[${flag}${index}]"
						name="budgets/budget[${flag}${index}]/date"
						class="required date input_text " style="width: 70px" />
					</td>
				   <td align="center"><input
						name="budgets/budget[${flag}${index}]/budget_total" id="budget_total_[${flag}${index}]"
						class="input_text required valueGreatEqual:budget_total_[${flag}${index}]:budget_fund_[${flag}${index}]"
						onfocus="InitInput.setNumber(this,8,4,2)"
						style="text-align: right; width: 100px" label="总投入金额"
						value="<x:out select="$budget/budget_total"/>" />
					</td>
					
					<td align="center"><input
						name="budgets/budget[${flag}${index}]/budget_fund" id="budget_fund_[${flag}${index}]"
						class="input_text required"
						onfocus="InitInput.setNumber(this,8,4,2)"
						onchange="countTable('tblBudgets','total_funds',5);lw('total_funds1','total_funds');"
						style="text-align: right; width: 100px" label="申请资助额"
						value="<x:out select="$budget/budget_fund"/>" />
					</td>



				<c:set value="${index+1}" var="index" scope="page" />
			</x:forEach>
		</tr>
			<script type="text/javascript">
				showAllDateTag("tblBudgets");
			</script>
	</tbody>
</table>
<br>

<table width="98%" align="center">
	<tr>
		<td><input class="button" name="cmdAddbefore" type=button
			value="添加"
			onclick="addNewRow('tblBudgets');showDateTag('tblBudgets');">
			<input class="button" name="cmdMovePrev" type=button value="上移"
			onclick="movePrev('tblBudgets','selBudgets')"> <input
			class="button" name="cmdMoveNext" type=button value="下移"
			onclick="moveNext('tblBudgets','selBudgets')"> <input
			class="button" name="cmddel" type=button value="删除"
			onclick="deleteSelectedRow('tblBudgets','申请资助资金及使用计划');countTable('tblBudgets','total_funds',5);">
		</td>
	</tr>
</table>